import os
import sys
import django

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.extend([BASE_DIR, ])
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "finance_c2c.settings")
django.setup()

from apps.sales_man.models import ChannelProduct
from apps.product.models import Product


def insert_channel_product():
    product_queryset = Product.objects.all()
    for i in product_queryset:
        ChannelProduct.objects.get_or_create(
            channel_id=1,
            product=i
        )


if __name__ == '__main__':
    insert_channel_product()
